import axios from 'axios'
import Qs from 'qs'

const instance = axios.create({
  baseURL: 'http://localhost:8080',
  // timeout: 1000,
  headers: {
    'Content-Type':'application/x-www-form-urlencoded',
    'X-Requested-With': 'XMLHttpRequest',
  },
  transformRequest: [function (data) {
    data = Qs.stringify(data);
    return data;
  }],
  withCredentials:true   //加了这段就可以跨域了
})

export default instance
